negotiator.issue
Class IssueInteger

java.lang.Object
  extended by negotiator.issue.Objective
      extended by negotiator.issue.Issue
          extended by negotiator.issue.IssueInteger
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class IssueInteger
extends Issue

Specific type of issue which specifies an integer range [min, max]. An example is the price of a car, assuming that the price can only be specified in whole euro's. Assumption 1: integer-valued issues have a fixed range, with a lower and upper bound. Assumption 2: value ranges for issue are shared between agents. Assumption 3: step size for integer valued issue is 1.

Author:
Tim Baarslag & Koen Hindriks & Dmytro Tykhonov
See Also:
Serialized Form

Constructor Summary
IssueInteger(java.lang.String name, int issueNumber, int min, int max)
          Create a new issue issue given the name of the issue, its unique ID, and the value range [min, max].
IssueInteger(java.lang.String name, int issueNumber, int min, int max, Objective objParent)
          Create a new issue issue given the name of the issue, its unique ID, its parent, and the value range [min, max].
 
Method Summary
 boolean checkInRange(Value val)
          Method to check if the given value is in the range specified by the issue.
 java.lang.String convertToString()
           
 int getLowerBound()
           
 ISSUETYPE getType()
          This method is added for convenience.
 int getUpperBound()
           
 boolean setLowerBound(int lowerbound)
           
 boolean setUpperBound(int upperbound)
           
 SimpleElement toXML()
          Returns a SimpleElement representation of this issue.
 
Methods inherited from class negotiator.issue.Issue
addChild
 
Methods inherited from class negotiator.issue.Objective
children, equalContents, equals, getAllowsChildren, getChildAt, getChildCount, getChildren, getChildWithID, getDescription, getHighestObjectiveNr, getIndex, getName, getNumber, getObjective, getParent, getPath, getPreorderEnumeration, getPreorderIssueEnumeration, getPreorderObjectiveEnumeration, getSiblings, getUserObject, hashCode, insert, isIssue, isLeaf, isObjective, isParent, remove, remove, removeFromParent, setDescription, setName, setNumber, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IssueInteger

public IssueInteger(java.lang.String name,
                    int issueNumber,
                    int min,
                    int max)
Create a new issue issue given the name of the issue, its unique ID, and the value range [min, max].

Parameters:
name - of the issue.
issueNumber - uniqueID of the isue.
min - minimum value of the range of values.
max - maximum value of the range of values.

IssueInteger

public IssueInteger(java.lang.String name,
                    int issueNumber,
                    int min,
                    int max,
                    Objective objParent)
Create a new issue issue given the name of the issue, its unique ID, its parent, and the value range [min, max].

Parameters:
name - of the issue.
issueNumber - uniqueID of the isue.
min - minimum value of the range of values.
max - maximum value of the range of values.
objParent - parent objective of the issue.
Method Detail

checkInRange

public boolean checkInRange(Value val)
Description copied from class: Issue
Method to check if the given value is in the range specified by the issue.

Specified by:
checkInRange in class Issue
Parameters:
val - to be checked.
Returns:
true if in range.

getLowerBound

public final int getLowerBound()
Returns:
lowest valid value of the value range.

getUpperBound

public final int getUpperBound()
Returns:
highest valid value of the value range.

setUpperBound

public boolean setUpperBound(int upperbound)
Parameters:
upperbound - to which the upperbound of the value range must be set.
Returns:
true is valid upperbound.

setLowerBound

public boolean setLowerBound(int lowerbound)
Parameters:
lowerbound - to which the lowerbound of the value range must be set.
Returns:
true is valid lowerbound.

toXML

public SimpleElement toXML()
Returns a SimpleElement representation of this issue.

Overrides:
toXML in class Issue
Returns:
The SimpleElement with this issues attributes

getType

public ISSUETYPE getType()
Description copied from class: Objective
This method is added for convenience. It is simply an alternative implementation of the getType method from the Issue class. It will always return that the type is Objective. This method must be overridden in Issue to return the type of the Issue.

Specified by:
getType in class Issue
Returns:
ISSUETYPE.OBJECTIVE

convertToString

public java.lang.String convertToString()
Specified by:
convertToString in class Issue
Returns:
corresponding string representation